package com.anda.logistics.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Transient;

import com.anda.logistics.map.util.CommUtil;

@Entity
public class FreightDeliver {
	private long id;
	private long freightId;
	private long truckId;
	private int freightState;
	private Date startDate;
	private Date endDate;
	private long receiveUserId;
	private long deliverUserId;
	
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getFreightId() {
		return freightId;
	}
	public void setFreightId(long freightId) {
		this.freightId = freightId;
	}
	public long getTruckId() {
		return truckId;
	}
	public void setTruckId(long truckId) {
		this.truckId = truckId;
	}
	public int getFreightState() {
		return freightState;
	}
	public void setFreightState(int freightState) {
		this.freightState = freightState;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	public long getReceiveUserId() {
		return receiveUserId;
	}
	public void setReceiveUserId(long receiveUserId) {
		this.receiveUserId = receiveUserId;
	}
	public long getDeliverUserId() {
		return deliverUserId;
	}
	public void setDeliverUserId(long deliverUserId) {
		this.deliverUserId = deliverUserId;
	}
	@Transient
	public String getStartDate8(){
		return CommUtil.getDate8FromDate(startDate);
	}
	@Transient
	public String getEndDate8(){
		return CommUtil.getDate8FromDate(endDate);
	}
}
